package basic.socket.upload;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author bingo
 * @Description
 * @Date 2018/7/24
 */
public class Server {

    public static void main(String[] args) {
        try {
            ServerSocket serverSocket = new ServerSocket(8888);
            System.out.println("服务区已经启动。。。。。。");
            while (true){
                Socket socket =   serverSocket.accept();
                FileServerThread fileServerThread = new FileServerThread(socket);
                Thread thread = new Thread(fileServerThread);
                thread.start();
                System.out.println("启动了一条线程");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
